import 'reflect-metadata';
import { DataSource } from 'typeorm';
import { Product } from './src/entities/product.entity';
import { ProductOption } from './src/entities/product-option.entity';
import { Cart } from './src/entities/cart.entity';
import { Category } from './src/entities/category.entity';

const AppDataSource = new DataSource({
  type: 'mysql',
  host: 'localhost',
  port: 3306,
  username: 'root',
  password: 'lfx7788fanpan',
  database: 'Taro-react-wx-backend',
  entities: [Product, ProductOption, Cart, Category],
  synchronize: true,
  connectorPackage: 'mysql2',
  logging: false,
});

export default AppDataSource
